import java.util.Arrays;
import java.util.Scanner;

public class Test {
    //在数组中查找指定元素
    //法一：暴力查找（遍历）
   /* public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5,6,7,8,9,10};
        Scanner scanner = new Scanner(System.in);
        int target = scanner.nextInt();
        //如果找到了，就返回目标数在数组中的下标；找不到，就返回-1
        int ret = arraySearchNum(array, target);
        System.out.println(ret);
    }
    public static int arraySearchNum(int[] array, int target){
        for (int i = 0; i < array.length; i++) {
            if(array[i] == target){
                return i;
            }
        }
        return -1;
    }*/


    /*public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5};
        int[] arraycopy = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            arraycopy[i] = array[i];
        }
        System.out.println(Arrays.toString(arraycopy));
    }*/


   /* public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5};
        //                         被拷贝的数组    要拷贝的长度（可以实现扩容）
        int[] ret = Arrays.copyOf(array, array.length*2);
        System.out.println(Arrays.toString(ret));
    }*/


   /*public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5};
        //  from：开始拷贝的初始下标    被拷贝的数组   to：拷贝到的末位置
        //  [0,3)——>也就是拷贝0，1，2
        int[] ret = Arrays.copyOfRange(array, 0,3);
        System.out.println(Arrays.toString(ret));
    }*/


    /*public static void main(String[] args) {
        int[][] array1 = new int[][]{{1,2,3},{4,5,6}};
        int[][] array2 = {{1,2,3},{4,5,6}};//上面的简化
        int[][] array3 = new int[2][3];

        //下面是错误的初始化方式(或者创建方式)
        //int[][] array4 = new int[][]{1,2,3,4,5,6};(简化也不行)
        //int[][] array5 = new int[][3];(不能只申明列，行不可以省略)
    }*/


    /*public static void main(String[] args) {
        int[][] array = new int[][]{{1,2,3},{4,5,6}};
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }*/


    /*public static void main(String[] args) {
        int[][] array = new int[][]{{1,2,3}, {4,5,6}};
        System.out.println(array.length);
        System.out.println(array[0].length);
        System.out.println(array[1].length);
    }*/


    /*public static void main(String[] args) {
        int[][] array = new int[][]{{1,2,3}, {4,5,6}};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }*/


    /*public static void main(String[] args) {
        int[][] array = new int[][]{{1,2,3}, {4,5,6}};
        for (int[] ret : array) {
            for (int x : ret) {
                System.out.print(x+" ");
            }
            System.out.println();
        }
    }*/


    /*public static void main(String[] args) {
        int[][] array = new int[][]{{1,2,3}, {4,5,6}};
        String ret = Arrays.deepToString(array);
        System.out.println(ret);
    }*/


    /*public static void main(String[] args) {
        int[][] array = new int[2][];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");//error
            }
            System.out.println();
        }
    }*/


    /*public static void main(String[] args) {
        int[][] array = new int[2][3];
        array[0] = new int[]{1,2};
        array[1] = new int[]{3,4,5};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }*/


    public static void main(String[] args) {
        Student student = new Student();
        student.name = "张三";
        student.age = 18;
        student.func();
    }
}


class Student1 {
    public String name;
    public int age;

    public static void main(String[] args) {

    }
    public void func(){
        System.out.println("姓名："+name+" 年龄："+age);
    }
}


class Dog1{
    public String name;//名字
    public int age;//年龄
    public void func(){
        System.out.println(name+" :汪汪汪");
    }
}